<?php
$this->breadcrumbs = array(
	'Quản lý nhân vật sự kiện',
);
?>
<!-- BEGIN PORTLET-->
 
<div class="row">
	<div class="col-md-12">
    	<div class="portlet">
        	<div class="portlet-title">
            	<div class="caption"><i class="icon-bar-chart"></i>Danh sách nhân vật sự kiện</div>
                <div class="actions">
                    	<?php echo CHtml::link('<span><i class="icon-plus"></i> Thêm nhân vật</span>', array('/Events/artists/create'), array('class'=>'btn blue btn-sm')); ?>
                </div>
            </div>
<div class="portlet-body">

	<?php $this->widget('zii.widgets.grid.CGridView', array(
		'id'=>'slide-grid',
		'dataProvider'=>$model->search(),
		'ajaxUpdate'=>true,
		'filter'=>$model,
		'itemsCssClass'=>'table table-striped table-bordered table-advance table-hover',
		'pager'=>array(
	        'header'=>'',
			'maxButtonCount'=>10,
	        'header'=>'',
	        'prevPageLabel'=>'<i class="icon-angle-left"></i></a>',
	        'nextPageLabel'=>'<i class="icon-angle-right"></i></a>',
	        'firstPageLabel'=>'First',
	        'lastPageLabel'=>'Last',
	        'footer'=>'',
			'selectedPageCssClass'=>'active',
			'hiddenPageCssClass'=>'disabled',
	        'htmlOptions'=>array(
	            'class'=>'pagination pagination-sm',
	        ),
	    ),
		'columns'=>array(
            array(
                'name'=>'id',
                'value'=>'$data->id',
                'filter'=>'',
            ),
            array(
                'name'=>'nickname',
                'type'=>'raw',
                'value'=>'CHtml::link($data->nickname,array("/Events/artists/view","slug"=>$data->url),array("target"=>"_blank"))',
            ),
            array(
                'name'=>'gender',
                'value'=>'($data->gender === "F" ? "Nữ" : "Nam")',
                'filter'=>CHtml::activeDropDownList($model,"gender",array(''=>'',' F'=>'Nữ', 'M'=>'Nam'), array('class'=>'form-control')),
            ),
			array(
				'class'=>'CButtonColumn',
				'header'=>'Action',
				'template'=>'{event} {view} {update} {delete}',
				'buttons'=>array(
                    'event'=>array(
						'label'=>'<i class="icon-plus"></i>',
                        'url'=>'array("/Events/artists/event", "slug"=>$data->url)',
						'imageUrl'=>false,
						'options'=>array(
							'class'=>'btn default btn-xs red',
							'title'=>'Danh sách Sự kiện'
						),
					),
					'view'=>array(
						'label'=>'<i class="icon-share"></i>',
						'imageUrl'=>false,
                        'url'=>'array("/Events/artists/view", "slug"=>$data->url)',
						'options'=>array(
							'class'=>'btn default btn-xs blue',
							'title'=>'View'
						),
					),
					'update'=>array(
						'label'=>'<i class="icon-edit"></i>',
						'imageUrl'=>false,
                        'url'=>'array("/Events/artists/update", "slug"=>$data->url)',
						'options'=>array(
							'class'=>'btn default btn-xs green',
							'title'=>'Edit'
						),
					),
					'delete'=>array(
						'label'=>'<i class="icon-trash"></i>',
						'imageUrl'=>false,
						'options'=>array(
							'class'=>'btn default btn-xs black',
							'title'=>'Delete'
						),
					),
				),
				'htmlOptions'=>array(
					'width'=>'160px',
					'class'=>'text-center'
				),
			),
		),
		'htmlOptions'=>array(
			'class'=>''
		),
	)); ?>
            </div>
        </div>
    </div>
</div>
